#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
#define PERIOD 500 


uint low = 0;
	

sbit led = P3^0;


void delay(uint xus);


void main(){
	while(1){
		led = 1;
		delay(50000);
		for(low = 0; low < PERIOD; low++){
			led = 0;
			delay(low);
			led = 1;
			delay(PERIOD - low);
		}
		led = 0;
		delay(50000);
		for(low = PERIOD - 1; low > 0; low--){
			led = 0;
			delay(low);
			led = 1;
			delay(PERIOD - low);
		}
	}
}


void delay(uint xus){ 
	while(xus--);
}